<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class SetupMenusTable extends Migration {

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //

        // Creates the users table
        Schema::create('menus', function ($table) {
            $table->increments('id');
            $table->string('name',50)->nullable()->comment('名称');
            $table->integer('parent_id')->unsigned()->default(0)->comment('父菜单ID');
            $table->string('keyword',50)->nullable()->comment('关键字');

            $table->index('parent_id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
        Schema::drop('menus');
    }

}
